package face.pay.web.income.controller;

import face.pay.common.income.IIncomeBaseService;
import face.pay.entity.IncomeInfo;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.util.page.PageData;
import face.pay.util.page.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 用户收入
 */
@Controller
@RequestMapping("/income")
public class UserIncomeController
{

    @Autowired
    IIncomeBaseService iIncomeBaseService;

    @RequestMapping("/list")
    public String list(){
        return "income/list";
    }


    /**
     * 我的收益记录
     * @param loginUser
     * @return
     */
    @RequestMapping("/queryData")
    @ResponseBody
    public PageData queryData(@CurrentUser  UserInfo loginUser, IncomeInfo incomeInfo, PageParam pageParam){

        incomeInfo.setOemId(loginUser.getOemId());
        incomeInfo.setUserId(loginUser.getId());

        return  iIncomeBaseService.queryData(incomeInfo,pageParam,loginUser);

    }


}
